import fetch from 'common/src/utils/fetch'

const api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/designservice/optTeacher/list',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 保存课题
    save(data) {
        return fetch({
            url: '/api/designservice/optTeacher/save',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 提交选题
    submit(data) {
        return fetch({
            url: '/api/designservice/optTeacher/createFlow',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 编辑课题
    update(data) {
        return fetch({
            url: '/api/designservice/optTeacher/edit',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 删除课题
    delete(data) {
        return fetch({
            url: '/api/designservice/optTeacher/batchDelete',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查校内导师
    getInnerTutor(data) {
        return fetch({
            url: '/api/designservice/tutor/inner/getSelect',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查校外导师
    getOutsideTutor(data) {
        return fetch({
            url: '/api/designservice/tutor/out/getSelect',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查课题来源
    getSource(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSource/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查课题性质
    getNature(data) {
        return fetch({
            url: '/api/designservice/settingSubjectProperties/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查社会实践
    getPractice(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSociaPractice/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查学院
    getCollege() {
        let authId = localStorage.getItem('activeAuthId')
        return fetch({
            url: `/api/designservice/common/college?authId=${authId}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // // 根据入学年份和学院查专业
    // getSubjectByGrade(college, grade) {
    //     return fetch({
    //         url: `/api/designservice/common/findSubjectByCurrentGrade?college=${college}&gradeId=${grade}`,
    //         method: 'get',
    //         headers: {
    //             'Content-Type': 'application/json'
    //         }
    //     })
    // },
    // 根据毕业年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 根据年级和专业查方向
    getDirection(data) {
        return fetch({
            url: '/api/commonservice/directionMainten/findDirectionMaintenList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查审核进度
    getProgress(applyNo) {
        return fetch({
            url: `/api/workflow/approval/selectApproFlow?no=${applyNo}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    }
}

export default api
